<template>
  <div class="setting-container">
    <van-cell title="修改密码" is-link />
    <van-cell title="提交反馈" is-link />
    <van-cell title="版本" value="v1.0.0" />

    <van-button block type="danger" class="logout" @click="logout">退出登录</van-button>
  </div>
</template>

<script>
export default {
  methods: {
    logout() {
      this.$dialog
        .confirm({
          message: '确认退出吗',
          confirmButtonColor: '#ee0a24',
        })
        .then(() => {
          this.$store.commit('clearToken')
          this.$store.commit('clearUserInfo')
          this.$store.commit('clearShopCar')
          this.$router.push('/login')
        })
        .catch(() => {})
    },
  },
}
</script>

<style lang="scss" scoped>
.setting-container {
  .logout {
    position: fixed;
    bottom: 0;
  }
}
</style>
